import { Component, OnInit, ViewChild,Output ,EventEmitter} from '@angular/core';
import { ModalDirective } from 'ng2-bootstrap/modal';
import {modalConfigDefaults} from "ng2-bootstrap/modal";
//设置自己的弹框规则
// export class myModalConfigDefaults implements ModalOptions{
// 	modalConfigDefaults=new myModalConfigDefaults();
// }
@Component({
	selector: 'ShowModel',
	templateUrl: 'ShowModel.component.html',
	viewProviders:[ModalDirective]
})

export class ShowModelComponent implements OnInit {

	@Output('chooseEt')
	chooseEt:EventEmitter<boolean>=new EventEmitter<boolean>();
	ngOnInit() {
		//使用默认的弹框规则
		this.childModal.config=modalConfigDefaults;
		// this.childModal.show();
	 }

	//与modal的id相对应获取弹框的视图
	@ViewChild('childModal') public childModal: ModalDirective;

	public showChildModal(): void {
		this.childModal.show();
	}

	public hideChildModal(): void {
		this.childModal.hide();
		this.chooseEt.emit(false);
	}
}